package com.sfac.springboot.springboot.modules.test.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sfac.springboot.springboot.modules.common.entity.AbstractEntity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "test_card")
public class Card extends AbstractEntity {

    private String cardNum;

    @OneToOne(mappedBy = "studentCard", cascade = CascadeType.ALL)
    @JsonIgnore
    private Student student;

    public String getCardNum() {
        return cardNum;
    }

    public void setCardNum(String cardNum) {
        this.cardNum = cardNum;
    }

    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }
}
